package com.finalProject;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.List;

/**
 * author: Jimmmy Smile
 * date: 2021-06-10 13:41::41
 * positioan: com.finalProject
 * e-mail:jimmysmileltl@163.com
 **/
public class AdapterOf_Income  extends ArrayAdapter {
        public final String TAG = "myadapter";
    public  AdapterOf_Income(Context context, int resourse, List<Income> hp){
            super(context,resourse, hp);

        }
        public View getView(int position , View convertView, ViewGroup parent){
            View itemView=convertView;
            if(itemView==null){
                itemView= LayoutInflater.from(getContext()).inflate(R.layout.list_item_income,parent,false);
            }
            Income hpitem =(Income) getItem(position);
            //Log.i(TAG, "getView: "+hpitem.getCity());
            TextView order =(TextView)itemView.findViewById(R.id.order);
            TextView city =(TextView)itemView.findViewById(R.id.city);
            TextView income =(TextView)itemView.findViewById(R.id.income);
            order.setText(hpitem.getOrder());
            city.setText(hpitem.getCity());
            income.setText(hpitem.getIncome());

            return  itemView;
        }
    }
